<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibTools: H:/project/LibTools/src/ipc/IpcIoSocket.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibTools
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.16 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','搜索');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_b94456e2763cc4ff61641ee1fd517631.html">ipc</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">IpcIoSocket.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_ipc_io_socket_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef __IPCIOSOCKET_H__</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define __IPCIOSOCKET_H__</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_ipc_socket_8h.html">./internal/IpcSocket.h</a>&quot;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_ipc_base_8h.html">./internal/IpcBase.h</a>&quot;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;utility&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160; </div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<a class="code" href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160; </div>
<div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html">   15</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_c_ipc_io_socket.html">CIpcIoSocket</a> :<span class="keyword">public</span> <a class="code" href="class_c_ipc_socket.html">CIpcSocket</a></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;{</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;    <a class="code" href="class_c_ipc_io_socket.html#af155ea58714eeec479388ba768f17ed7">delete_class_copy_operator</a>(<a class="code" href="class_c_ipc_io_socket.html">CIpcIoSocket</a>);</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html#a63d759232d6f7a52c0b68c8c5a03010d">   20</a></span>&#160;    <a class="code" href="class_c_ipc_io_socket.html#a63d759232d6f7a52c0b68c8c5a03010d">CIpcIoSocket</a>() :<a class="code" href="class_c_ipc_socket.html">CIpcSocket</a>(),<a class="code" href="class_c_ipc_io_socket.html#aeb594ab857345061829fd093f810823b">_ioService</a>(<a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>) {}</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> CIpcIoClass&gt;</div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html#a8dda301e4f042e00577fad8adcc2fe51">   27</a></span>&#160;    <a class="code" href="class_c_ipc_io_socket.html#a8dda301e4f042e00577fad8adcc2fe51">CIpcIoSocket</a>(CIpcIoClass* service) :<a class="code" href="class_c_ipc_socket.html">CIpcSocket</a>(service-&gt;GetIpcServicePtr()), <a class="code" href="class_c_ipc_io_socket.html#aeb594ab857345061829fd093f810823b">_ioService</a>(service) {}</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html#aaf8c0a9870b0f3d3f8353e53d912cfc5">   30</a></span>&#160;    <a class="code" href="class_c_ipc_io_socket.html#aaf8c0a9870b0f3d3f8353e53d912cfc5">CIpcIoSocket</a>(<a class="code" href="class_c_basic_service.html">CBasicService</a>* service) :<a class="code" href="class_c_ipc_socket.html">CIpcSocket</a>(service), <a class="code" href="class_c_ipc_io_socket.html#aeb594ab857345061829fd093f810823b">_ioService</a>(<a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>) {}</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160; </div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html#a5d144fbebc7fd3c7c1fd98cd6e8b0385">   33</a></span>&#160;    <a class="code" href="class_c_ipc_io_socket.html#a5d144fbebc7fd3c7c1fd98cd6e8b0385">~CIpcIoSocket</a>() { <a class="code" href="class_c_ipc_io_socket.html#aeb594ab857345061829fd093f810823b">_ioService</a> = <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>; }</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#ifdef STD11</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    <a class="code" href="class_c_ipc_io_socket.html#a63d759232d6f7a52c0b68c8c5a03010d">CIpcIoSocket</a>(<a class="code" href="class_c_ipc_io_socket.html">CIpcIoSocket</a>&amp;&amp; ipc) :<a class="code" href="class_c_ipc_socket.html">CIpcSocket</a>(std::move(*dynamic_cast&lt;<a class="code" href="class_c_ipc_socket.html">CIpcSocket</a>*&gt;(&amp;ipc))) {</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;        ipc._ioService = <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>;</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    }</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <a class="code" href="class_c_ipc_io_socket.html">CIpcIoSocket</a>&amp; operator= (<a class="code" href="class_c_ipc_io_socket.html">CIpcIoSocket</a>&amp;&amp; ipc) {</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        <span class="keywordflow">if</span> (<span class="keyword">this</span> != &amp;ipc){</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;            <a class="code" href="class_c_ipc_io_socket.html#aeb594ab857345061829fd093f810823b">_ioService</a> = <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;            std::swap(<a class="code" href="class_c_ipc_io_socket.html#aeb594ab857345061829fd093f810823b">_ioService</a>, ipc._ioService);</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;            *dynamic_cast&lt;CIpcSocket*&gt;(<span class="keyword">this</span>) = std::move(*dynamic_cast&lt;CIpcSocket*&gt;(&amp;ipc));</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        }</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    }</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_ipc_io_socket.html#ae246cd093979191a046035281dc0f490">Swap</a>(<a class="code" href="class_c_ipc_io_socket.html">CIpcIoSocket</a>&amp; ipc){</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        std::swap(<a class="code" href="class_c_ipc_io_socket.html#aeb594ab857345061829fd093f810823b">_ioService</a>, ipc.<a class="code" href="class_c_ipc_io_socket.html#aeb594ab857345061829fd093f810823b">_ioService</a>);</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        <a class="code" href="class_c_socket.html#a816347ac8821a8288a38645702bee10e">CSocket::Swap</a>(*dynamic_cast&lt;CSocket*&gt;(&amp;ipc));</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    }</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160; </div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> CIpcIoClass&gt;</div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html#a7be5cfe2d25054961fd191493ed8e986">   63</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_ipc_io_socket.html#a7be5cfe2d25054961fd191493ed8e986">SetIoService</a>(CIpcIoClass* service) {</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        <a class="code" href="class_c_ipc_io_socket.html#aeb594ab857345061829fd093f810823b">_ioService</a> = service;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;        this-&gt;<a class="code" href="class_c_socket.html#ad08fc2df680d1fd84035f5aada97dd3a">SetService</a>(service-&gt;GetIpcServicePtr());</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    }</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160; </div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> CIpcIoClass&gt;</div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html#a6aadd72887ec0a53307ccf58e449e74b">   70</a></span>&#160;    CIpcIoClass* <a class="code" href="class_c_ipc_io_socket.html#a6aadd72887ec0a53307ccf58e449e74b">GetIoService</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (CIpcIoClass*)<a class="code" href="class_c_ipc_io_socket.html#aeb594ab857345061829fd093f810823b">_ioService</a>; }</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160; </div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html#a3a1d1b2d30077f467f705a68f132278b">   80</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_ipc_io_socket.html#a3a1d1b2d30077f467f705a68f132278b">AsyncAccept</a>(<span class="keyword">const</span> Func&amp; func) {</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        <span class="keywordflow">if</span> (this-&gt;<a class="code" href="class_c_socket.html#a4639bf4536b44ec11a7fc37b73981c8e">GetService</a>() != <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>){</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;            dynamic_cast&lt;CIpcBase*&gt;(this-&gt;<a class="code" href="class_c_socket.html#a4639bf4536b44ec11a7fc37b73981c8e">GetService</a>())-&gt;AsyncAccept(*<span class="keyword">this</span>, <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> AcceptHandleNull&lt;Func&gt;(func)));</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        }</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    }</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html#aacfb8bd7bbd81aee5cb6f875a666fa6d">   86</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_ipc_io_socket.html#aacfb8bd7bbd81aee5cb6f875a666fa6d">AsyncAccept</a>(<span class="keyword">const</span> Func&amp; func, <span class="keywordtype">void</span>* invoker){</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <span class="keywordflow">if</span> (this-&gt;<a class="code" href="class_c_socket.html#a4639bf4536b44ec11a7fc37b73981c8e">GetService</a>() != <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>){</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;            dynamic_cast&lt;CIpcBase*&gt;(this-&gt;<a class="code" href="class_c_socket.html#a4639bf4536b44ec11a7fc37b73981c8e">GetService</a>())-&gt;AsyncAccept(*<span class="keyword">this</span>, <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> AcceptHandle&lt;Func&gt;(func)), invoker);</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        }</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    }</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160; </div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html#aea0eaeeff5e08a45bb8d8a76a19f9b26">   93</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_ipc_io_socket.html#aea0eaeeff5e08a45bb8d8a76a19f9b26">AsyncConnect</a>(Func func) {</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;        <span class="keywordflow">if</span> (this-&gt;<a class="code" href="class_c_socket.html#a4639bf4536b44ec11a7fc37b73981c8e">GetService</a>() != <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>){</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;            dynamic_cast&lt;CIpcBase*&gt;(this-&gt;<a class="code" href="class_c_socket.html#a4639bf4536b44ec11a7fc37b73981c8e">GetService</a>())-&gt;AsyncConnect(*<span class="keyword">this</span>, <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> ConnectHandleNull&lt;Func&gt;(func)), <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>);</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;        }</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    }</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html#ab4c7e55fd4aaf5e531df3e579292f0ae">   99</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_ipc_io_socket.html#ab4c7e55fd4aaf5e531df3e579292f0ae">AsyncConnect</a>(Func func, <span class="keywordtype">void</span>* invoker){</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;        <span class="keywordflow">if</span> (this-&gt;<a class="code" href="class_c_socket.html#a4639bf4536b44ec11a7fc37b73981c8e">GetService</a>() != <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>){</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;            dynamic_cast&lt;CIpcBase*&gt;(this-&gt;<a class="code" href="class_c_socket.html#a4639bf4536b44ec11a7fc37b73981c8e">GetService</a>())-&gt;AsyncConnect(*<span class="keyword">this</span>, <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> ConnectHandle&lt;Func&gt;(func)), invoker);</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;        }</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    }</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160; </div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html#ae6003ecda1ea67d6950f1d899f53229d">  106</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_ipc_io_socket.html#ae6003ecda1ea67d6950f1d899f53229d">AsyncRead</a>(<span class="keyword">const</span> <a class="code" href="class_c_stream_iteator.html">CStreamIteator</a>&amp; buff, Func func) {</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;        <span class="keywordflow">if</span> (this-&gt;<a class="code" href="class_c_socket.html#a4639bf4536b44ec11a7fc37b73981c8e">GetService</a>() != <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>){</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;            dynamic_cast&lt;CIpcBase*&gt;(this-&gt;<a class="code" href="class_c_socket.html#a4639bf4536b44ec11a7fc37b73981c8e">GetService</a>())-&gt;AsyncRead(*<span class="keyword">this</span>, buff, <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> ReadHandleNull&lt;Func&gt;(func)), <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>);</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        }</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    }</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html#a56e25b6015f6521d0485be26b2f0694e">  112</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_ipc_io_socket.html#a56e25b6015f6521d0485be26b2f0694e">AsyncRead</a>(<span class="keyword">const</span> <a class="code" href="class_c_stream_iteator.html">CStreamIteator</a>&amp; buff, Func func, <span class="keywordtype">void</span>* invoker) {</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;        <span class="keywordflow">if</span> (this-&gt;<a class="code" href="class_c_socket.html#a4639bf4536b44ec11a7fc37b73981c8e">GetService</a>() != <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>){</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;            dynamic_cast&lt;CIpcBase*&gt;(this-&gt;<a class="code" href="class_c_socket.html#a4639bf4536b44ec11a7fc37b73981c8e">GetService</a>())-&gt;AsyncRead(*<span class="keyword">this</span>, buff, <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> ReadHandle&lt;Func&gt;(func)), invoker);</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;        }</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    }</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html#a7fd8168f2a53b68d5c2c17281e694fa0">  119</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_ipc_io_socket.html#a7fd8168f2a53b68d5c2c17281e694fa0">AsyncSend</a>(<span class="keyword">const</span> <a class="code" href="class_c_stream_iteator.html">CStreamIteator</a>&amp; buff, Func func) {</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        <span class="keywordflow">if</span> (this-&gt;<a class="code" href="class_c_socket.html#a4639bf4536b44ec11a7fc37b73981c8e">GetService</a>() != <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>){</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;            dynamic_cast&lt;CIpcBase*&gt;(this-&gt;<a class="code" href="class_c_socket.html#a4639bf4536b44ec11a7fc37b73981c8e">GetService</a>())-&gt;AsyncSend(*<span class="keyword">this</span>, buff, <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> WriteHandleNull&lt;Func&gt;(func)), <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>);</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;        }</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    }</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00125"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html#a10e4f9891af8e21a003b162391093350">  125</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_ipc_io_socket.html#a10e4f9891af8e21a003b162391093350">AsyncSend</a>(<span class="keyword">const</span> <a class="code" href="class_c_stream_iteator.html">CStreamIteator</a>&amp; buff, Func func, <span class="keywordtype">void</span>* invoker) {</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        <span class="keywordflow">if</span> (this-&gt;<a class="code" href="class_c_socket.html#a4639bf4536b44ec11a7fc37b73981c8e">GetService</a>() != <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>){</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;            dynamic_cast&lt;CIpcBase*&gt;(this-&gt;<a class="code" href="class_c_socket.html#a4639bf4536b44ec11a7fc37b73981c8e">GetService</a>())-&gt;AsyncSend(*<span class="keyword">this</span>, buff, <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> WriteHandle&lt;Func&gt;(func)), invoker);</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        }</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    }</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160; </div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> CIpcIoClass, <span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00132"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html#a4695744ee4ddba22fe49ec8e9ae006f0">  132</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_c_ipc_io_socket.html#a4695744ee4ddba22fe49ec8e9ae006f0">Post</a>(CIpcIoClass* service, Func func) {</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;        <span class="keywordflow">if</span> (service != <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>){</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;            dynamic_cast&lt;CIpcBase*&gt;(service-&gt;GetIpcServicePtr())-&gt;<a class="code" href="class_c_ipc_io_socket.html#a4695744ee4ddba22fe49ec8e9ae006f0">Post</a>(<a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> <a class="code" href="class_post_handle_null.html">PostHandleNull&lt;Func&gt;</a>(func)), <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>);</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;        }</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    }</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> CIpcIoClass, <span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html#abc2d50b42f5b34e02bfd80601414f6a2">  138</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_c_ipc_io_socket.html#abc2d50b42f5b34e02bfd80601414f6a2">Post</a>(CIpcIoClass* service, Func func, <span class="keywordtype">void</span>* invoker) {</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;        <span class="keywordflow">if</span> (service != <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>){</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;            dynamic_cast&lt;CIpcBase*&gt;(service-&gt;GetIpcServicePtr())-&gt;<a class="code" href="class_c_ipc_io_socket.html#a4695744ee4ddba22fe49ec8e9ae006f0">Post</a>(<a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> <a class="code" href="class_post_handle.html">PostHandle&lt;Func&gt;</a>(func)), invoker);</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;        }</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    }</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00145"></a><span class="lineno"><a class="line" href="class_c_ipc_io_socket.html#aeb594ab857345061829fd093f810823b">  145</a></span>&#160;    <span class="keywordtype">void</span>* <a class="code" href="class_c_ipc_io_socket.html#aeb594ab857345061829fd093f810823b">_ioService</a>;</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;};</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;<a class="code" href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160; </div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;<span class="preprocessor">#endif // __IPCIOSOCKET_H__</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclass_c_stream_iteator_html"><div class="ttname"><a href="class_c_stream_iteator.html">CStreamIteator</a></div><div class="ttdef"><b>Definition:</b> <a href="_stream_byte_8h_source.html#l00011">StreamByte.h:11</a></div></div>
<div class="ttc" id="aclass_shared_ptr_html"><div class="ttname"><a href="class_shared_ptr.html">SharedPtr&lt; HandleBase &gt;</a></div></div>
<div class="ttc" id="a_ipc_base_8h_html"><div class="ttname"><a href="_ipc_base_8h.html">IpcBase.h</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_a5d144fbebc7fd3c7c1fd98cd6e8b0385"><div class="ttname"><a href="class_c_ipc_io_socket.html#a5d144fbebc7fd3c7c1fd98cd6e8b0385">CIpcIoSocket::~CIpcIoSocket</a></div><div class="ttdeci">~CIpcIoSocket()</div><div class="ttdoc">析构函数</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00033">IpcIoSocket.h:33</a></div></div>
<div class="ttc" id="atools_8h_html_a201ce692c9dca6599e5c12d00167419b"><div class="ttname"><a href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div><div class="ttdeci">#define DEF_BEG_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00036">tools.h:36</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_a4695744ee4ddba22fe49ec8e9ae006f0"><div class="ttname"><a href="class_c_ipc_io_socket.html#a4695744ee4ddba22fe49ec8e9ae006f0">CIpcIoSocket::Post</a></div><div class="ttdeci">static void Post(CIpcIoClass *service, Func func)</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00132">IpcIoSocket.h:132</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_abc2d50b42f5b34e02bfd80601414f6a2"><div class="ttname"><a href="class_c_ipc_io_socket.html#abc2d50b42f5b34e02bfd80601414f6a2">CIpcIoSocket::Post</a></div><div class="ttdeci">static void Post(CIpcIoClass *service, Func func, void *invoker)</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00138">IpcIoSocket.h:138</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_aeb594ab857345061829fd093f810823b"><div class="ttname"><a href="class_c_ipc_io_socket.html#aeb594ab857345061829fd093f810823b">CIpcIoSocket::_ioService</a></div><div class="ttdeci">void * _ioService</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00145">IpcIoSocket.h:145</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_ae246cd093979191a046035281dc0f490"><div class="ttname"><a href="class_c_ipc_io_socket.html#ae246cd093979191a046035281dc0f490">CIpcIoSocket::Swap</a></div><div class="ttdeci">virtual void Swap(CIpcIoSocket &amp;ipc)</div><div class="ttdoc">交换两个套接字</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00053">IpcIoSocket.h:53</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_a10e4f9891af8e21a003b162391093350"><div class="ttname"><a href="class_c_ipc_io_socket.html#a10e4f9891af8e21a003b162391093350">CIpcIoSocket::AsyncSend</a></div><div class="ttdeci">void AsyncSend(const CStreamIteator &amp;buff, Func func, void *invoker)</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00125">IpcIoSocket.h:125</a></div></div>
<div class="ttc" id="aclass_c_socket_html_a4639bf4536b44ec11a7fc37b73981c8e"><div class="ttname"><a href="class_c_socket.html#a4639bf4536b44ec11a7fc37b73981c8e">CSocket::GetService</a></div><div class="ttdeci">virtual CBasicService * GetService() const</div><div class="ttdoc">返回服务基类</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8cpp_source.html#l00271">Socket.cpp:271</a></div></div>
<div class="ttc" id="aclass_c_socket_html_a816347ac8821a8288a38645702bee10e"><div class="ttname"><a href="class_c_socket.html#a816347ac8821a8288a38645702bee10e">CSocket::Swap</a></div><div class="ttdeci">virtual void Swap(CSocket &amp;sock)</div><div class="ttdoc">交换两个套接口类</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8cpp_source.html#l00290">Socket.cpp:290</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_aaf8c0a9870b0f3d3f8353e53d912cfc5"><div class="ttname"><a href="class_c_ipc_io_socket.html#aaf8c0a9870b0f3d3f8353e53d912cfc5">CIpcIoSocket::CIpcIoSocket</a></div><div class="ttdeci">CIpcIoSocket(CBasicService *service)</div><div class="ttdoc">构造一个ipc套接字并设置服务类指针</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00030">IpcIoSocket.h:30</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_ae6003ecda1ea67d6950f1d899f53229d"><div class="ttname"><a href="class_c_ipc_io_socket.html#ae6003ecda1ea67d6950f1d899f53229d">CIpcIoSocket::AsyncRead</a></div><div class="ttdeci">void AsyncRead(const CStreamIteator &amp;buff, Func func)</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00106">IpcIoSocket.h:106</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_aea0eaeeff5e08a45bb8d8a76a19f9b26"><div class="ttname"><a href="class_c_ipc_io_socket.html#aea0eaeeff5e08a45bb8d8a76a19f9b26">CIpcIoSocket::AsyncConnect</a></div><div class="ttdeci">void AsyncConnect(Func func)</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00093">IpcIoSocket.h:93</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_ab4c7e55fd4aaf5e531df3e579292f0ae"><div class="ttname"><a href="class_c_ipc_io_socket.html#ab4c7e55fd4aaf5e531df3e579292f0ae">CIpcIoSocket::AsyncConnect</a></div><div class="ttdeci">void AsyncConnect(Func func, void *invoker)</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00099">IpcIoSocket.h:99</a></div></div>
<div class="ttc" id="aclass_c_socket_html_ad08fc2df680d1fd84035f5aada97dd3a"><div class="ttname"><a href="class_c_socket.html#ad08fc2df680d1fd84035f5aada97dd3a">CSocket::SetService</a></div><div class="ttdeci">virtual void SetService(CBasicService *service)</div><div class="ttdoc">关联相应的工作类</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8cpp_source.html#l00047">Socket.cpp:47</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html"><div class="ttname"><a href="class_c_ipc_io_socket.html">CIpcIoSocket</a></div><div class="ttdoc">用于ipc进行io投递的套接字类</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00015">IpcIoSocket.h:15</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_a56e25b6015f6521d0485be26b2f0694e"><div class="ttname"><a href="class_c_ipc_io_socket.html#a56e25b6015f6521d0485be26b2f0694e">CIpcIoSocket::AsyncRead</a></div><div class="ttdeci">void AsyncRead(const CStreamIteator &amp;buff, Func func, void *invoker)</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00112">IpcIoSocket.h:112</a></div></div>
<div class="ttc" id="atools_8h_html_ac909db71799bb22cb7d636a34cd785e4"><div class="ttname"><a href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div><div class="ttdeci">#define DEF_END_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00038">tools.h:38</a></div></div>
<div class="ttc" id="aclass_post_handle_html"><div class="ttname"><a href="class_post_handle.html">PostHandle</a></div><div class="ttdoc">用户投递回调</div><div class="ttdef"><b>Definition:</b> <a href="_sock_tools_8h_source.html#l00242">SockTools.h:242</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_a63d759232d6f7a52c0b68c8c5a03010d"><div class="ttname"><a href="class_c_ipc_io_socket.html#a63d759232d6f7a52c0b68c8c5a03010d">CIpcIoSocket::CIpcIoSocket</a></div><div class="ttdeci">CIpcIoSocket()</div><div class="ttdoc">构造一个ipc套接字</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00020">IpcIoSocket.h:20</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_a7fd8168f2a53b68d5c2c17281e694fa0"><div class="ttname"><a href="class_c_ipc_io_socket.html#a7fd8168f2a53b68d5c2c17281e694fa0">CIpcIoSocket::AsyncSend</a></div><div class="ttdeci">void AsyncSend(const CStreamIteator &amp;buff, Func func)</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00119">IpcIoSocket.h:119</a></div></div>
<div class="ttc" id="a_ipc_socket_8h_html"><div class="ttname"><a href="_ipc_socket_8h.html">IpcSocket.h</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_a3a1d1b2d30077f467f705a68f132278b"><div class="ttname"><a href="class_c_ipc_io_socket.html#a3a1d1b2d30077f467f705a68f132278b">CIpcIoSocket::AsyncAccept</a></div><div class="ttdeci">void AsyncAccept(const Func &amp;func)</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00080">IpcIoSocket.h:80</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_af155ea58714eeec479388ba768f17ed7"><div class="ttname"><a href="class_c_ipc_io_socket.html#af155ea58714eeec479388ba768f17ed7">CIpcIoSocket::delete_class_copy_operator</a></div><div class="ttdeci">delete_class_copy_operator(CIpcIoSocket)</div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_aacfb8bd7bbd81aee5cb6f875a666fa6d"><div class="ttname"><a href="class_c_ipc_io_socket.html#aacfb8bd7bbd81aee5cb6f875a666fa6d">CIpcIoSocket::AsyncAccept</a></div><div class="ttdeci">void AsyncAccept(const Func &amp;func, void *invoker)</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00086">IpcIoSocket.h:86</a></div></div>
<div class="ttc" id="atools_8h_html_ab689500aaec0db066e3ac9483d3fe425"><div class="ttname"><a href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a></div><div class="ttdeci">#define NullPtr</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00119">tools.h:119</a></div></div>
<div class="ttc" id="aclass_post_handle_null_html"><div class="ttname"><a href="class_post_handle_null.html">PostHandleNull</a></div><div class="ttdef"><b>Definition:</b> <a href="_sock_tools_8h_source.html#l00255">SockTools.h:255</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_a7be5cfe2d25054961fd191493ed8e986"><div class="ttname"><a href="class_c_ipc_io_socket.html#a7be5cfe2d25054961fd191493ed8e986">CIpcIoSocket::SetIoService</a></div><div class="ttdeci">void SetIoService(CIpcIoClass *service)</div><div class="ttdoc">设置ipc服务类</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00063">IpcIoSocket.h:63</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_a6aadd72887ec0a53307ccf58e449e74b"><div class="ttname"><a href="class_c_ipc_io_socket.html#a6aadd72887ec0a53307ccf58e449e74b">CIpcIoSocket::GetIoService</a></div><div class="ttdeci">CIpcIoClass * GetIoService() const</div><div class="ttdoc">返回CIpcIoServer、CIpcIoClient类</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00070">IpcIoSocket.h:70</a></div></div>
<div class="ttc" id="aclass_c_basic_service_html"><div class="ttname"><a href="class_c_basic_service.html">CBasicService</a></div><div class="ttdoc">服务类 基类</div><div class="ttdef"><b>Definition:</b> <a href="_service_base_8h_source.html#l00015">ServiceBase.h:15</a></div></div>
<div class="ttc" id="aclass_c_ipc_socket_html"><div class="ttname"><a href="class_c_ipc_socket.html">CIpcSocket</a></div><div class="ttdoc">ipc通信专用套接字</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_socket_8h_source.html#l00010">IpcSocket.h:10</a></div></div>
<div class="ttc" id="aclass_c_ipc_io_socket_html_a8dda301e4f042e00577fad8adcc2fe51"><div class="ttname"><a href="class_c_ipc_io_socket.html#a8dda301e4f042e00577fad8adcc2fe51">CIpcIoSocket::CIpcIoSocket</a></div><div class="ttdeci">CIpcIoSocket(CIpcIoClass *service)</div><div class="ttdoc">构造一个ipc套接字并设置服务类指针</div><div class="ttdef"><b>Definition:</b> <a href="_ipc_io_socket_8h_source.html#l00027">IpcIoSocket.h:27</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
